package com.bsj.power.common.def.vo.pls.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.bsj.power.common.def.vo.pls.PathReportCountVO;
import lombok.Data;

/**
 * @author yinhao
 * @version 1.0
 * @description 进出报表数据导出
 * @date 2024/9/19
 */
@Data
@ColumnWidth(15)
public class PathReportCountExcelVO {

    /**
     * 人员名称
     */
    @ExcelProperty(value = "人员名称", index = 0)
    private String personnelName;

    /**
     * 设备名称
     */
    @ExcelProperty(value = "设备名称", index = 1)
    private String nickName;

    /**
     * 围栏名称
     */
    @ExcelProperty(value = "围栏名称", index = 2)
    private String pathName;
    /**
     * 时间
     */
    @ExcelProperty(value = "时间", index = 3)
    private String createTime;

    /**
     * 国标设备集合
     */
    @ExcelProperty(value = "关联摄像头个数", index = 4)
    private Integer deviceNum;

    /**
     * 类型 1进 2出
     */
    @ExcelProperty(value = "类型", index =5)
    private String type;

    public void add(PathReportCountVO vo) {
        this.personnelName = vo.getPersonnelName();
//        this.empNo = vo.getEmpNo();
        this.nickName = vo.getNikeName();
        this.pathName = vo.getPathName();
        this.createTime = vo.getCreateTime();
        this.deviceNum = vo.getDeviceList() == null ? 0 : vo.getDeviceList().size();
        if (vo.getType() == 1) {
            this.type = "出区域";
        } else {
            this.type = "进区域";
        }
    }
}
